#include "stdafx.h"
#include "service\storage\file\TeamFileService.h"
#include "model\BaseModel.h"
#include "model\Team.h"

 


std::istream& operator>>(std::istream& is, Team& team) {
  getline(is, team.name_);
  getline(is, team.address_);
  int n;
  is >> n;
  is.ignore();
  for (int i = 0; i < n; ++i) {
    int id;
    is >> id;
    is.ignore();
    team.AddPlayer(id);
  }
  return is;
}

std::ostream& operator<<(std::ostream& os, const Team& team) {
  os << team.name() << '\n' << team.address() << '\n' << team.NumPlayers();
  TCollection<int>::CollectionPair iters = team.GetPlayers();
  for (; iters.first != iters.second; ++iters.first) {
    os << '\n' << *iters.first;
  }
  return os;
}